$(function() {

	$.ajax({
		type : "POST",
		url : baseURL + "sys/build/list",
		success : function(r) {
			if (r.code === 0) {
				vm.builds = r.page.list;
			} else {
				alert(r.msg);
			}
		}
	});
});

var vm = new Vue({
	el : '#rrapp',
	data : {

		comAsset : {
			buildId : ""
		},
		builds : []
	},
	methods : {

		saveOrUpdate : function(event) {
			var url = vm.comAsset.assetId == null ? "asset/save"
					: "asset/update";
			$.ajax({
				type : "POST",
				url : baseURL + url,
				data : JSON.stringify(vm.comAsset),
				success : function(r) {
					if (r.code === 0) {
						alert('操作成功', function(index) {
							vm.back();
						});
					} else {
						alert(r.msg);
					}
				}
			});
		},

		back : function(event) {
			parent.setSrc("modules/com/asset.html");
		}
	}
});